<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center patentapplication_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub patentapplication_fd0_0'>
          <view class='flex flex-wrap align-center patentapplication_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="back" data-url="1">
            <text class='fu-iconfont2  patentapplication_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='patentapplication_fd0_0_c1_c0'>专利申请</text>
          </view>
          <view class='flex flex-wrap align-center justify-end patentapplication_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout patentapplication_flex_1">
        <view class='flex flex-direction align-stretch patentapplication_fd1_0'>
          <text class='patentapplication_fd1_0_c0'>请选择您想申请专利的相关动态内容</text>
          <view class='flex flex-wrap align-center justify-between patentapplication_fd1_0_c1' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/grzx/selectdynamic/selectdynamic`">
            <benben-input type="text" :placeholder="`请选择`" confirm-type="done" :maxlength="-1" :adjust-position="false"
              :disabled='true' placeholder-style="color:#999;font-size:28rpx" v-model="freetransactionlist_name" />
            <image class='patentapplication_fd1_0_c1_c1' mode="aspectFit" :src='STATIC_URL+"11.png"'></image>
          </view>
        </view>
        <view class='flex flex-direction align-stretch patentapplication_fd1_1'>
          <text class='patentapplication_fd1_0_c0'>专利产品的简短描述</text>
          <view class='flex flex-wrap patentapplication_fd1_1_c1'>
            <benben-textarea class='flex patentapplication_input_fd1_1_c1' :placeholder="'请输入'" :adjust-position='true'
              :maxlength="240" :show-num='true' placeholder-style="color:#999;font-size:28rpx" v-model="describe" />
            <template>
              <view class='flex flex justify-end patentapplication_numberfd1_1_c1_c0'>
                <text>{{describe.length}}</text>
                <text>/</text>
                <text>240</text>
              </view>
            </template>
          </view>
        </view>
        <view class='flex flex-direction align-stretch patentapplication_fd1_1'>
          <text class='patentapplication_fd1_0_c0'>上传产品图案（0/9）</text>
          <benben-images-upload ref="benbenImagesUploadfd1_2_c1" :img-list.sync="imgUrl" :img-ids.sync="imgids"
            :maxlength="9">
            <template #content="{ num, maxlength, isShow}">
              <view class="flex flex-wrap align-start flex patentapplication_fd1_2_c1">

                <view v-for="(image, index) in imgUrl" :key="index"
                  class='flex position-relative patentapplication_fd1_2_c10'>
                  <text class='fu-iconfont2 position-absolute patentapplication_fd1_2_c100'
                    @tap.stop="$refs.benbenImagesUploadfd1_2_c1.delImage(index)">&#xE8E7;</text>
                  <image class='patentapplication_fd1_2_c101'
                    @tap.stop="$refs.benbenImagesUploadfd1_2_c1.previewImage(index)" mode="aspectFit" :src='image'>
                  </image>
                </view>

                <image class='patentapplication_fd1_2_c11'
                  @tap.stop="$refs.benbenImagesUploadfd1_2_c1.manyChooseImage()" v-if="isShow" mode="aspectFit"
                  :src='STATIC_URL+"194.jpg"'></image>

              </view>
            </template>
          </benben-images-upload>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex flex-wrap align-center justify-center benben-position-layout flex patentapplication_flex_2"
        :style="{height:(120+bottomSafeAreaRpx)+'rpx',paddingBottom:bottomSafeAreaRpx+'rpx', }" @click.stop="submit">
        <button class='patentapplication_fd2_0'>人工客服</button>

      </view>
      <view :style="{height: (120+bottomSafeAreaRpx)+'rpx'}"></view>


    </view>
  </page-body>
</template>
<script>
  export default {
    components: {},

    data() {
      return {
        "fd1_1_c1": "",
        "imgids": "",
        "imgUrl": [],
        describe: '',
        picture: '',
        freetransactionlist_id: '',
        freetransactionlist_name: ''
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      uni.$on('patent', (data) => {
        console.log('222', data)
        this.freetransactionlist_id = data.aid
        this.freetransactionlist_name = data.title
      })
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      submit() {
        if (!this.freetransactionlist_id) {
          this.$message.info('请选择动态内容')
          return
        }
        if (!this.describe) {
          this.$message.info('请输入专利产品的简短描述')
          return
        }
        if (this.imgUrl.length == 0) {
          this.$message.info('请上传产品图案')
          return
        }
        this.$api.post(global.apiUrls.post6698d09915081, {
          describe: this.describe,
          picture: this.imgUrl.join(','),
          freetransactionlist_id: this.freetransactionlist_id
        }).then(res => {
          if (res.data.code == 1) {
            // uni.navigateBack()
            uni.makePhoneCall({
              phoneNumber: res.data.data.phone
            })
          } else {
            this.$message.info(res.data.msg)
          }
        })
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: rgba(255, 255, 255, 1);
    background-size: 100% auto;
  }

  .patentapplication_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .patentapplication_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .patentapplication_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .patentapplication_fd0_0_c0 {
    width: 120rpx;
  }

  .patentapplication_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .patentapplication_flex_1 {
    margin: 80rpx auto 0rpx auto;
    width: 686rpx;
  }

  .patentapplication_fd1_2_c11 {
    width: 160rpx;
    height: 160rpx;
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .patentapplication_fd1_2_c101 {
    width: 160rpx;
    height: 160rpx;
  }

  .patentapplication_fd1_2_c100 {
    top: 0rpx;
    right: 0rpx;
    z-index: 10;
    color: #ff5536;
  }

  .patentapplication_fd1_2_c10 {
    margin: 0rpx 24rpx 24rpx 0rpx;
  }

  .patentapplication_fd1_2_c1 {
    width: 675rpx;
    padding: 24rpx 0rpx 0rpx 24rpx;
  }

  .patentapplication_numberfd1_1_c1_c0 {
    width: 100%;
    font-size: 24rpx;
    color: var(--benbenFontColor0);
    line-height: 46rpx;
    font-weight: 400;
  }

  .patentapplication_input_fd1_1_c1 {
    width: 100%;
    height: 140rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333;
    white-space: pre-wrap;
  }

  .patentapplication_fd1_1_c1 {
    background: #F6F7F9;
    width: 675rpx;
    border-radius: 10rpx 10rpx 10rpx 10rpx;
    padding: 10rpx;
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .patentapplication_fd1_1 {
    margin: 80rpx 0rpx 0rpx 0rpx;
  }

  .patentapplication_fd1_0_c1_c1 {
    width: 32rpx;
    height: 32rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
  }

  .patentapplication_fd1_0_c1 {
    background: rgba(246, 247, 249, 1);
    margin: 24rpx 0rpx 0rpx 0rpx;
    line-height: 100rpx;
    height: 100rpx;
    background-size: 100% auto;
    border-radius: 16rpx;
    padding: 0rpx 16rpx 0rpx 16rpx;
  }

  .patentapplication_fd1_0_c0 {
    color: rgba(26, 26, 26, 1);
    font-size: 32rpx;
  }

  .patentapplication_fd1_0 {
    margin: 50rpx 0rpx 0rpx 0rpx;
  }

  .patentapplication_flex_2 {
    width: 750rpx;
    height: 120rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
    left: 0rpx;
  }

  .patentapplication_fd2_0 {
    background: linear-gradient(180deg, #176BE8 0%, #5A5CFC 100%);
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 686rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    height: 88rpx;
  }
</style>
